1. Field of the Invention
This present invention relates to a method and a system for buffering a data file into a buffer memory, especially to read a coded audio data file in an optical storage medium and buffering it to a buffer memory.
2. Description of the Prior Art
Please refer to FIG. 1 and FIG. 2. FIG. 1 is a schematic diagram of data arrangement for a conventional audio compact disk (CD) 10. FIG. 2 is a schematic diagram of a block 20 constituted with the frames 12 shown in FIG. 1. A conventional audio CD 10 comprises a plurality of frames 12. Each frame comprises a one-byte subcode 14 and two twelve-byte main data 16. Four-byte parities 18 exist between and after each of the main data 16, respectively.
Before a conventional CD drive receives command from a computer host to read the CD 10, a microprocessor of the CD drive detects errors for each of the frames 12. The microprocessor combines two main data 16 into a 24-byte main data 17. After error detection, the microprocessor combines 98 frames to constitute a block 20. Thus every audio data file in the CD 10 comprises a plurality of blocks 20 which are sequentially arranged. When the CD drive reads the audio data files in the CD 10, it reads the audio information from the blocks 20.
As shown in FIG. 2, each of the blocks 20 comprises a sync pattern 22, a subcode block 24 and a main data block 26. The sync pattern 22 is used to detect the starting point of the block 20. The subcode block 24 comprises a corresponding address and audio data file information of the block 20. In a conventional music CD, for example, the audio data file information records information about the title and duration of the song, and the like. The main data block 26 records the audio data file.
The conventional CD drive decodes and buffers the audio data file to a buffer memory in the CD drive, and then transmits the decoded audio data from the buffer memory to the computer host.
Conventionally, it is the same controller to decode and buffer the subcode block 24 and the main data block 26. However, the time for decoding the subcode block 24 is different from that for the main data block 26. Therefore the main data block 26 buffered in the buffer memory lags behind the subcode block 24. If the lags of each buffering are different, such lags may cause data loss or data overlap in the buffer memory, resulting in pop noise when the user listens to the music in the CD. Even one can make the lags consistent. However, the loss of data may still cause some audio data loss when copying data.